package Controller;

import Service.TestService;
import domain.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController // 整合了 @Controller + @RequestBody两个注解
@RequestMapping("/test")
public class TestController {

    @Autowired
    private TestService testService;

    @RequestMapping("/findAllTest")
    public List<Test> findAllTest(){

        List<Test> allTest = testService.findAllTest();
        return allTest;

    }
}
